

# 车主 业主 保险
aaa=sqlContext.sql("""
    create table jiazhuang.all_2019027 as
    select
        *
    FROM
        dw.sms_log
    where msg_content LIKE '%业主%'
      or msg_content LIKE '%车主%'
      or msg_content LIKE '%房款%'
      or msg_content LIKE '%车款%'
      or msg_content LIKE '%车贷%'
      or  msg_content LIKE '%房贷%'
      or msg_content LIKE '%保险%'
      or msg_content LIKE '%保单%'
      or  msg_content LIKE '%续保%'
      or  msg_content LIKE '%家装%'
      or  msg_content LIKE '%装修%'
      or  msg_content LIKE '%装饰%'
      or  msg_content LIKE '%汽车%'
      or  msg_content LIKE '%投保%'
      or  msg_content LIKE '%车险%'
      or  msg_content LIKE '%财险%'
""")

http://www.soyoung.com
https://www.yuemei.com
http://www.igengmei.com

import pandas as pd
aaa=sqlContext.sql("""
SELECT
    DISTINCT  t.msisdn
FROM (
    select
        msisdn
    FROM
        dw.beauty_yichang
    WHERE unix_timestamp(insert_time) >=1525104000
) t
 LEFT OUTER JOIN
 history.meirong t2
 ON t.msisdn = t2.msisdn
            WHERE t2.msisdn is null
 limit 50000
""")
writer = pd.ExcelWriter("/home/games_data/result/20180907/nvxing_yichang_20181031.xlsx",engine='xlsxwriter')
aaa.toPandas().to_excel(writer, sheet_name='Sheet1')
writer.save()


# load data local inpath '/home/data/zeng/2018105.txt.txt' into table history.meirong partition(pt='20181105');



